package com.starlink.model.util;

import com.starlink.model.dtomapper.StarTravelDtoMapper;
import com.starlink.model.domain.StarTravelDO;
import com.starlink.model.vo.StarTravelVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class StarTravelConvert {

    public static List<StarTravelVO> buildStarTravelVoList(List<StarTravelDO> starTravelDOList) {
        if (CollectionUtils.isEmpty(starTravelDOList)) {
            return Lists.newArrayList();
        }
        List<StarTravelVO> starTravelVOList = new ArrayList<>();
        for (StarTravelDO starTravelDO : starTravelDOList) {
            starTravelVOList.add(StarTravelDtoMapper.INSTANCE.do2VO(starTravelDO));
        }

        return starTravelVOList;
    }
}
